package com.mckillion.Exercise9;

public class RobotController {
//INVOKER
	private Robot robotModel;


	public RobotController( Robot robot ){
            this.robotModel = robot;
	}

	public void fireCommand( Command currentCommand ) {

           if ( currentCommand == null ) {
               throw new UnsupportedOperationException("Sorry command was not found!");
           } else {
        	   robotModel.grab();
        	   System.out.println("Grabbed");
        	   
        	   robotModel.drive();
        	   System.out.println("Driven");
        	   // call the Command  to execute
        	   // print out a message to say that the invoker has done this
           }
	}

}